package main

import "fmt"

type Person struct {
	name string
	age  int
	sex  string
}

func (p *Person) setValue(name string, age int, sex string) {
	p.sex = sex
	p.name = name
	p.age = age
}

type rep struct {
	Person
	Hobby string
}

func (r *rep) RepSayHellow(h string) {
	r.Hobby = h
	fmt.Printf("我叫%s,今年%d岁，性别是%s,我的爱好是%s\n", r.name, r.age, r.sex, r.Hobby)
}

type pro struct {
	Person
	WorkYear int
}

func (p *pro) ProSayHellow(y int) {
	p.WorkYear = y
	fmt.Printf("我叫%s,今年%d岁，性别是%s,我的工作年限是%d\n", p.name, p.age, p.sex, p.WorkYear)
}
func main() {
	var rep rep
	rep.setValue("张三", 23, "男")
	rep.RepSayHellow("狗仔")
	var pro pro
	pro.setValue("李四", 54, "女")
	pro.ProSayHellow(3)
}
